<%@ page language="java" import="java.util.*,com.bbs.model.User"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<link rel="stylesheet" type="text/css"
	href="images/eXtremeComponents/extremecomponents.css" />
<%@include file="../header.jsp"%>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="js/jquery-1.2.6.pack.js"></script>
<script type="text/javascript">
	window.onload = function() {
		CKEDITOR.replace('reply.reply_content');
	};
</script>

</head>
<%@include file="../menu.jsp"%>
<div id="content">

	<!-- Normal content: Stuff that's not going to be put in the left or right column. -->

	<div class="post">
		<h3>
			<strong><s:property value='topic.title' /> </strong>
		</h3>
		<div class="contentarea">
			<div class="details">
				<c:set var="topicuserid" value="${topic.user_id}"></c:set>
				作者：<strong>${topic.user_id}</strong> <a
					href="">
					<c:out value="${userCache[topicuserid].user_name}" />
					
					 </a>
				发布时间 ：<s:property value="topic.posttime" />
			</div>
			<img src="images/index/pic3.jpg" class="left" alt="A chinese dragon" />
			<p>
				<s:property value='topic.content' escape="false" />
			</p>
			<ul class="controls">
				<li><a href="" class="printerfriendly">保留</a></li>
				<li><a href="" class="comments">保留</a></li>
				<li><a href="javascript:void(0)"
					onclick="$('#<s:property value="topic.id" />').toggle('fast')"
					class="more">回复</a>
			</ul>
		</div>
	</div>
	<div id='<s:property value="topic.id"/>' style="display: none"
		class="post">
		<h4>对楼主的回复</h4>
		<div class="contentarea">
			<form method="post" action="replyAction!addReply.action">
				<table>
					<tr>

						<td><input type="hidden" name="reply.reply_topic_id"
							value="<s:property value='topic.id' />" /> <input type="hidden"
							name="reply.reply_parent_id" value="0" /> <input type="hidden"
							name="reply.reply_from_user_id"
							value="${sessionScope.UserSession.user.user_id}" /> <input
							type="hidden" name="reply.reply_to_user_id"
							value="${topic.user_id}" />
						</td>
					</tr>
					<tr>

						<td><textarea name="reply.reply_content"
								class="jquery_ckeditor"></textarea></td>
					</tr>
					<tr>
						<td><input type="submit" value="提交" />
						</td>
				</table>
			</form>
		</div>

	</div>



	<div class="divider1"></div>


	<!-- Primary content: Stuff that goes in the primary content column (by default, the left column) -->

	<div id="primarycontainer">
		<div id="primarycontent">
			<!-- Primary content area start##################################################### -->

			<s:iterator value="topicpmap.keySet()" id="key">
				<div class="post">
					
					<div class="contentarea">
						<div class="details">
							<a href="">
					</a>回复于：
							<s:property value="#key.reply_time" />
						</div>
						<img src="images/index/pic3.jpg" class="left"
							alt="A chinese dragon" />
						<p>
							<s:property value="#key.reply_content" escape="false" />
						</p>
						<ul class="controls">
							<li><a href="" class="printerfriendly">保留</a></li>
							<li><a href="" class="comments">保留</a></li>
							<li><a href="javascript:void(0)"
								onclick="$('#<s:property value="#key.reply_id" />').toggle('fast')"
								class="more">回复</a>
						</ul>
					</div>
				</div>

				<div class="divider2"></div>

				<div id=<s:property value="#key.reply_id" /> style="display: none"
					class="post">
					<h4>对楼上的回复</h4>
					<div class="contentarea">
						<form method="post" action="replyAction!addReply.action">
							<table>
								<tr>

									<td><input type="hidden" name="reply.reply_topic_id"
										value="<s:property value='topic.id' />" /> <input
										type="hidden" name="reply.reply_parent_id"
										value="<s:property value='#key.reply_id' />" /> <input
										type="hidden" name="reply.reply_from_user_id"
										value="${sessionScope.UserSession.user.user_id}" /> <input
										type="hidden" name="reply.reply_to_user_id"
										value="${topic.user_id}" /></td>

								</tr>
								<tr>

									<td><textarea name="reply.reply_content" cols="60"
											rows="10"></textarea></td>
								</tr>
								<tr>
									<td><input type="submit" value="提交"></td>
							</table>
						</form>
					</div>

				</div>

				<s:if test="topicpmap.get(#key).size>0">
					<s:iterator value="topicpmap.get(#key)" var="reply">
						<div class="post" style="margin-left:100px;">
							
							<div class="contentarea">
								<div class="details">
									Posted by <a href="">Jane Doe</a>
									<s:property value="#reply.reply_time" />
								</div>
								<img src="images/index/pic3.jpg" class="left" height="20"
									width="20" alt="A chinese dragon" />
								<p>
									<s:property value="#reply.reply_content" escape="false" />
								</p>
								<ul class="controls">
									<li><a href="" class="printerfriendly">保留</a>
									</li>
									<li><a class="comments">保留</a>
									</li>
									<li><a href="javascript:void(0)"
										onclick="$('#<s:property value="#reply.reply_id" />').toggle('fast')"
										class="more">回复</a>
								</ul>
							</div>
						</div>
						<div class="divider2"></div>

						<div id=<s:property value="#reply.reply_id" />
							style="display: none" class="post">
							<h4>对楼上的回复</h4>
							<div class="contentarea">
								<form method="post" action="replyAction!addReply.action">
									<table>
										<tr>
											<td><input type="hidden" name="reply.reply_topic_id"
												value="<s:property value='topic.id' />"> <input
												type="hidden" name="reply.reply_parent_id"
												value="<s:property value='#key.reply_id' />" /> <input
												type="hidden" name="reply.reply_from_user_id"
												value="${sessionScope.UserSession.user.user_id}" /> <input
												type="hidden" name="reply.reply_to_user_id"
												value='<s:property value="#key.reply_from_user_id" />'/>
											</td>
										</tr>
										<tr>
											<td><textarea name="reply.reply_content"
													class="jquery_ckeditor"></textarea></td>
										</tr>
										<tr>
											<td><input type="submit" value="提交">
											</td>
									</table>
								</form>
							</div>

						</div>
					</s:iterator>
				</s:if>
			</s:iterator>
			<!-- Primary content area end##################################################### -->
		</div>

	</div>


	<!-- Secondary content: Stuff that goes in the secondary content column (by default, the narrower right column) -->
	<div id="secondarycontent">
		<!-- Secondary content area start -->

		<!-- HINT: Set any div's class to "box" to encapsulate it in (you guessed it) a box -->
		<div class="box">
			<h4>Blandit Veroeros</h4>
			<div class="contentarea">
				<img src="images/index/pic2.jpg" class="left" alt="Random foliage" />
				<p>
					Sed etiam et lorem ipsum nulla vero et lobortis felis sed etiam.
					Lorem ipsum sit amet dolore. Nulla facilisi. Sed tortor. Aenean
					felis. Quisque eros etiam <a href="">sed
						commodo</a>.
				</p>
			</div>
		</div>

		<div>
			<h4>Nullam Dolore</h4>
			<div class="contentarea">
				<ul class="linklist">
					<li><a href="">Volutpat at varius sed</a>
					</li>
					<li><a href="">Sollicitudin et arcu</a></li>
					<li><a href="">Vivamus viverra nullam</a>
					</li>
					<li><a href="">Turpis vestibulum</a></li>
					<li><a href="">Sed etiam lorem ipsum</a></li>
					<li><a href="">Sit amet dolore nulla</a></li>
					<li><a href="">Facilisi sed tortor</a></li>
					<li><a href="">Aenean felis quisque</a></li>
					<li><a href="">Eros cras lobortis vel</a>
					</li>
					<li><a href="">Purus in eget odio
							sapien</a></li>
					<li><a href="">Adipiscing blandit</a></li>
				</ul>
			</div>
		</div>

		<!-- Secondary content area end -->
	</div>



</div>


<%@include file="../footer.jsp"%>